﻿using _17bang.Entities;
using _17bang.Repositories;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace _17bang.ViewComponents
{
    public class _Series :ViewComponent
    {
        private ArticleRepository articleRepository;
        public _Series()
        {
            articleRepository = new ArticleRepository();
        }
        public IList<SeriesArticles> SeriesArticles;
        public IViewComponentResult Invoke(int amount,int skip)
        {
            SeriesArticles = articleRepository.Find();
            return View(SeriesArticles.Take(amount).Skip(skip).ToList());
        }
    }
}
